<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>桃李科技-请假</title>
    <link rel="stylesheet" href="__ADMIN__/weUI/css/weui.min.css" />
    <link rel="stylesheet" href="__ADMIN__/weUI/css/page.css" />

</head>

<body ontouchstart>
    <div class="weui-toptips weui-toptips_warn js_tooltips">错误提示</div>
    <div class="page">
        <div class="page__hd">
            <h1 class="page__title">桃李科技_请假</h1>
            <!-- <p class="page__desc">表单输入</p> -->
            <p style="text-align: right;"><a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_primary" onclick="openAbsentLog();">请假记录</a></p>

        </div>
        <div class="page__bd">
            
            <div class="weui-cells__title">请假日期</div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">开始日期</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="date" value="<{$today}>" id="dtStart"/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label for="" class="weui-label">结束日期</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="date" value="<{$today}>" id="dtEnd"/>
                </div>
            </div>
            <div class="weui-cells__title">原因</div>
            <div class="weui-cells weui-cells_form">
                <div class="weui-cell">
                    <!-- <div class="weui-cell__hd">
                        <label class="weui-label">原因</label>
                    </div> -->
                    <div class="weui-cell__bd">
                        <textarea class="weui-textarea" id="txtReason" placeholder="请输入请假原因" rows="5"></textarea>
                        <!-- <div class="weui-textarea-counter"><span>0</span>/200</div> -->
                    </div>
                </div>
            </div>
            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_primary" href="javascript:" id="btnRest">提交</a>
            </div>
            <input type="hidden" name="weixinid" value="<{$weixinid}>" id="txtWeixinId">
        </div>
        <div class="weui-footer">
            <p class="weui-footer__links">
                <a href="javascript:void(0);" class="weui-footer__link">桃李科技</a>
            </p>
            <p class="weui-footer__text">Copyright &copy; 2015-2016 ittaoli.com</p>
        </div>
    </div>
    <!-- <script src="__ADMIN__/weUI/js/zepto.min.js"></script> -->
    <script src="__ADMIN__/weUI/js/jquery-1.11.2.min.js"></script>
    <script src="__ADMIN__/weUI/js/lub_weUI.js"></script>
    <!-- <script src="__ADMIN__/weUI/js/touch.js"></script> -->
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">
    $(function() {
        // alert($('#txtWeixinId').val());

        $('#btnRest').on('click',function(){
            if($('#txtReason').val()==''){
                alert('请假原因不能为空哦~');
                return;
            }
            lub.progress();
            var url='<{:U("rest")}>';
            $.post(url, { weixinid: $('#txtWeixinId').val(),start:$('#dtStart').val(),end:$('#dtEnd').val(),reason:$('#txtReason').val() }, function(response){
                  if(response){
                      if(response.res>0){
                        alert('请假成功！');
                      }else{
                        alert('请假失败！');
                      }
                  }else{
                    alert('请假失败！');
                  }
                  lub.hideProgress();
            })
        });
    });
    function openAbsentLog(){
        var weixinid=$('#txtWeixinId').val();
        window.location.href='<{:U("absentLog")}>'+'/weixinid/'+weixinid;
    }
    </script>
</body>

</html>
